package 剑指offer;

import javax.swing.tree.TreeNode;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;

/**
 * @ClassName _32从上到下打印二叉树
 * @Description TODO
 * @Author 昝亚杰
 * @Date 2022/3/1 20:49
 * Version 1.0
 **/
public class _32_I_从上到下打印二叉树 {
    /*public int[] levelOrder(TreeNode root) {
        if(root == null)
            return new int[0];
        Queue<TreeNode> queue = new LinkedList();
        ArrayList<Integer> arraylist = new ArrayList<Integer>();
        queue.add(root);
        while(!queue.isEmpty()){
            TreeNode now = queue.poll();
            arraylist.add(now.val);
            TreeNode left = now.left;
            TreeNode right = now.right;
            if(left != null){
                queue.add(left);
            }
            if(right != null){
                queue.add(right);
            }
        }
        int[] res = new int[arraylist.size()];
        for(int i = 0; i < res.length; i++){
            res[i] = arraylist.get(i);
        }
        return res;
    }*/
}
